//
//  LGGraverarServiceViewController.m
//  ligenyun
//
//  Created by Mac on 2018/4/9.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGGraverarServiceViewController.h"
#import "STTextView.h"
@interface LGGraverarServiceViewController ()
@property(nonatomic, strong) STTextView     *textView1;
@property(nonatomic, strong) STTextView     *textView2;
@property(nonatomic, strong) STTextView     *textView3;
@property(nonatomic, strong) STTextView     *textView4;
@end

@implementation LGGraverarServiceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.textView1 = [[STTextView alloc] initWithFrame:CGRectMake(15, 0, UIScreenWidth - 30, 80)];
    self.textView1.placeholder = @"请输入内容";
    self.textView2 = [[STTextView alloc] initWithFrame:CGRectMake(15, 0, UIScreenWidth - 30, 80)];
    self.textView2.placeholder = @"请输入内容";
    self.textView3 = [[STTextView alloc] initWithFrame:CGRectMake(15, 0, UIScreenWidth - 30, 80)];
    self.textView3.placeholder = @"请输入内容";
    self.textView4 = [[STTextView alloc] initWithFrame:CGRectMake(15, 0, UIScreenWidth - 30, 80)];
    self.textView4.placeholder = @"请输入内容";
    
    self.tableView.contentInset = UIEdgeInsetsZero;
    self.tableView.frame = CGRectMake(0, 0, UIScreenWidth, [TMUtils tabBarTop] - [TMUtils navgationBarBootom]);
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --SubView
- (void)configSubView{
    UIView * header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 40)];
    header.backgroundColor = [UIColor whiteColor];
    
    UIView *view1 = [self defultViewWithTitle:@"免费专车服务" textView:self.textView1];
    view1.top = 0;
    [header addSubview:view1];
    
    UIView *view2 = [self defultViewWithTitle:@"专业人员导购" textView:self.textView1];
    view2.top = view1.bottom;
    [header addSubview:view2];
    
    UIView *view3 = [self defultViewWithTitle:@"售后服务" textView:self.textView1];
    view3.top = view2.bottom;
    [header addSubview:view3];
    
    UIView *view4 = [self defultViewWithTitle:@"意见反馈" textView:self.textView1];
    view4.top = view3.bottom;
    [header addSubview:view4];
    
    header.height = view4.bottom;
    self.tableView.tableHeaderView = header;
    [self.tableView st_autoAdjustAllResponder];
}
- (UIView*)defultViewWithTitle:(NSString*)title textView:(STTextView*)textView{
    UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 125)];
    view.backgroundColor = [UIColor whiteColor];
    
    UIView * header = [TMUtils headerViewWithTitle:title];
    [view addSubview:header];
    
    [view addSubview:textView];
    textView.backgroundColor = [UIColor whiteColor];
    textView.top = header.bottom;
    return view;
}
@end
